home *** CD-ROM | disk | FTP | other *** search
/ Ray Dream Studio 5 / Ray Dream.iso / pc / DreamSDK / Windows / SAMPLES / SHADER / SHDR / CHECKER.H < prev    next >
Encoding:
C/C++ Source or Header  |  1997-07-11  |  1.9 KB  |  51 lines

  1. // Copyright (c)1995 Ray Dream, Inc. All Rights Reserved.
  2. /* $Id: Checker.h 1.1 1996/07/19 00:15:33 Damien Exp $ */
  3. // Example of a CheckerShader Creation
  4.  
  5. #ifndef __CHECKER__
  6. #define __CHECKER__
  7.  
  8. #ifndef __COMSHDR__
  9. #include "COMShdr.H"
  10. #endif
  11.  
  12. DEFINE_GUID(CLSID_CheckerShader, 0x1C2DAC60L, 0x2ED7, 0x101C, 0x88, 0x5F, 0x04, 0x02, 0x1C, 0x00, 0x70, 0x02);
  13.  
  14. // Data structure for exchange with the Shell
  15. struct CheckerShaderPublicData { 
  16.   short nbSquareU,nbSquareV;  // Number of squares (Horizontally and Vertically)
  17.   };
  18.  
  19. // Control the new checker shade
  20. #undef INTERFACE
  21. #define INTERFACE CheckerShader
  22. class CheckerShader : public COMShader {
  23. public :
  24.   CheckerShader();
  25.   ~CheckerShader();
  26.   
  27.   STDMETHODIMP_(I3DExtension*)  Clone(THIS);
  28.   STDMETHODIMP_(short)         GetResID(THIS);
  29.   STDMETHODIMP_(void*)          GetExtensionDataBuffer(THIS);
  30.   STDMETHODIMP_(Boolean)        IsEqualTo(THIS_ I3DExShader* aShader);
  31.   STDMETHODIMP_(Boolean)        DependsOnAppliedExtent(THIS);
  32.   STDMETHODIMP                  DoShade(THIS_ ShadingInOut* theShadingIO, ShadingElem* theShadingElem);
  33.   STDMETHODIMP                  GetValue(THIS_ NUM3D* result, ShadingIn* theShadingIn, ShadingElem* theShadingElem);
  34.   STDMETHODIMP                  GetColor(THIS_ COLOR3D* result, ShadingIn* theShadingIn, ShadingElem* theShadingElem);
  35.   STDMETHODIMP                  GetVector(THIS_ VECTOR3D* result, ShadingIn* theShadingIn, ShadingElem* theShadingElem);
  36.   STDMETHODIMP                  GetShadingFlags(THIS_ ShadingFlags* theFlags);
  37.   STDMETHODIMP_(ULONG)                    GetPreferredOutput(THIS);
  38.   
  39.   STDMETHODIMP_(ExtensionDataMap*) GetExtensionDataMap(THIS);
  40.  
  41.   CheckerShaderPublicData CheckerPublicData;
  42.   
  43. protected:
  44.   void         CopyData(COMShader* dest);
  45.   VECTOR2D     fMul;   // Preprocessing factor 
  46.                        // to convert UV Coordinate to "Checker" Coordinate
  47.   };
  48.                            
  49. #endif // __CHECKER__
  50.  
  51.